Conversation
- Introduced MAX_LOGS_SIZE environment variable to set the maximum allowed log size. - Implemented log size checking and cleanup logic in the container database. - Added utility function to parse human-readable size formats. - Updated README to document the new MAX_LOGS_SIZE configuration option.
- Changed CheckBox alignment from end to start for better layout consistency. - Adjusted CheckBox roll transformation for improved visual feedback. - Modified DropDown text margin for better spacing.
ivictbor
requested changes
Apr 24, 2025
README.md
Outdated
| | AGENT | Toggles agent mode. If enabled, there will be no web interface available, and all logs will be sent and stored on HOST | `false` | - | ||
| | HOST | Url to OnLogs host from protocol to domain name. | | if `AGENT=true` | ||
| | ONLOGS_TOKEN | Token that will use an agent to authorize and connect to HOST | Generates with OnLogs interface | if `AGENT=true` | ||
| | MAX_LOGS_SIZE | Maximum allowed total logs size before cleanup triggers. Accepts human-readable formats like 5GB, 500MB, 1.5GB etc. When exceeded, 30% of logs (by count) will be removed proportionally across containers starting from oldest | 5GB | - |
| return "other" | ||
| } | ||
|
|
||
| func checkAndManageLogSize(host string, container string) error { |
Contributor
There was a problem hiding this comment.
i can't see ussage of host and container function params
| func ParseHumanReadableSize(sizeStr string) (int64, error) { | ||
| sizeStr = strings.TrimSpace(strings.ToUpper(sizeStr)) | ||
| for _, unit := range units { | ||
| if strings.HasSuffix(sizeStr, unit.Suffix) { |
Contributor
There was a problem hiding this comment.
lets support 1g 1m etc also
if strings.HasSuffix(sizeStr, unit.Suffix) || strings.HasSuffix(sizeStr, strings.TrimSuffix(unit.Suffix, "B")) {
- Updated Docker build command to use --load for improved image handling. - Changed output binary name from 'main' to 'onlogs' in the Dockerfile. - Simplified log status key determination by removing redundant checks. - Enhanced log size management logic to ensure efficient cleanup of old logs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.